import type { UserModel } from "@/model/UserModel";
import type { FunctionModel } from "@/model/function_model/FunctionModel";
import { GaCacheManager } from "ga_utility_sdk_base"
export class GlobalTool {
    static fun:FunctionModel;
    private static currentUser:UserModel|null = null;
    static setCurrentUser(user:UserModel) {
        this.currentUser = user;
        let json = JSON.stringify(user);
        GaCacheManager.saveString("user",json);
    }
    static getCurrentUser():UserModel|null {
        if(!this.currentUser) {
            let json = GaCacheManager.stringValueForKey("user");
            if(json?.length) {
                this.currentUser = JSON.parse(json);
            }
        }
        return this.currentUser;
    }
}